package cn.itcast.bos.service.base.impl;

import cn.itcast.bos.dao.base.TakeTimeRepository;
import cn.itcast.bos.domain.base.TakeTime;
import cn.itcast.bos.service.TakeTimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service
public class TakeTimeServiceImpl implements TakeTimeService {

    @Autowired
    private TakeTimeRepository takeTimeRepository;
    @Override
    public List<TakeTime> findNoAssociationFixedArea() {

        return takeTimeRepository.findAll();
    }

    @Override
    public void save(TakeTime model) {
        takeTimeRepository.save(model);
    }

    @Override
    public Page<TakeTime> findALL(Specification<TakeTime> spec, Pageable pageable) {
        return takeTimeRepository.findAll(spec,pageable);
    }
}
